<?php

class FotoController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */

        $this->_helper->_layout->setLayout('about');

        $disco = new Application_Model_DbTable_Administrator();
        $this->view->disco = $disco->getAllDisco();

        /* Initialize action controller here */
        require_once "models/Db/Event_db.php";
        require_once "models/Utility/Utility.php";

        $utility_handle = new Utility();
        $eventHandle    = new Event_db();

        $pivaList = $eventHandle->getAllPiva();
        foreach ($pivaList as $pivaList2){
                $piva = $pivaList2['piva'];
                $temp = $eventHandle->getUniqueNamebyPiva($piva);
                $allDisco[$piva] = array ($temp['unique_name'], $temp['name']);
        }
        $allDisco = $utility_handle->subval_sort($allDisco,0);
        $this->view->allDisco = $allDisco;


        foreach ($pivaList as $pivaList2){
            $piva = $pivaList2['piva'];
            $temp = $eventHandle->getPaeseDsicoByPiva($piva);
            $paese[$piva] = $temp['paese'];
        }
        $this->view->paese = array_unique($paese);


        $category = $eventHandle->getAllCategory();
        $this->view->category = $category;

        $zonaList = array('Brescia','Verona','Mantova','Cremona');
        $this->view->zonaList = $zonaList;
    }

    public function indexAction()
    {
        // action body
    }


}

